/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package structures;
import it.unimi.dsi.fastutil.longs.*;
/**
 *
 * @author Gonzalo
 */
public class Map {

    private Long2LongOpenHashMap long2long=new Long2LongOpenHashMap(1000000);
    private long key=0;
    private long value=0;
    private long index=0;

    public Map(){
    }

    public void put(long key,long value){
        long2long.put(key, value);
    }

    public void init(){
        index=0;
    }

    public long pollFirstKey(){
        while(!long2long.containsKey(index))
            index++;
        key=index;
        value=long2long.get(key);
        long2long.remove(key);
        return key;
    }

    public long getKey(){
        return key;
    }

    public long getValue(){
        return value;
    }

    public boolean isEmpty(){
        return long2long.isEmpty();
    }

    public long size(){
        return long2long.size();
    }

    public void clear(){
        long2long.clear();
    }
}